package com.eva.admin.biz.cms.article.vo;

import com.eva.dao.cms.model.CmsArticle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("文章管理视图对象")
public class CmsArticleVO extends CmsArticle {

    @ApiModelProperty(value="创建人主键")
    private Integer creatorId;

    @ApiModelProperty(value="创建人姓名")
    private String creatorRealName;

    @ApiModelProperty(value="更新人主键")
    private Integer updaterId;

    @ApiModelProperty(value="更新人姓名")
    private String updaterRealName;

    @ApiModelProperty(value="所属栏目")
    private List<Category> categories;

    @ApiModelProperty(value="所属标签")
    private List<Tag> tags;

    @Data
    @ApiModel("文章所属栏目")
    public static class Category {

        @ApiModelProperty("栏目ID")
        private Integer id;

        @ApiModelProperty("栏目标题")
        private String title;
    }

    @Data
    @ApiModel("文章所属标签")
    public static class Tag {

        @ApiModelProperty("标签ID")
        private Integer id;

        @ApiModelProperty("标签名称")
        private String name;
    }
}
